home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / f90 / cpu_time.z / cpu_time
Encoding:
Text File  |  2002-10-03  |  2.5 KB  |  75 lines

  1. CPU_TIME(3I)                                          Last changed: 4-13-99
  2.  
  3.  
  4. NNAAMMEE
  5.      CCPPUU__TTIIMMEE - Returns the processor time
  6.  
  7. SSYYNNOOPPSSIISS
  8.      CCPPUU__TTIIMMEE (([TTIIMMEE==]_t_i_m_e))
  9.  
  10. IIMMPPLLEEMMEENNTTAATTIIOONN
  11.      UNICOS, UNICOS/mk, and IRIX systems
  12.  
  13.      CF90, MIPSpro 7 Fortran 90
  14.  
  15. SSTTAANNDDAARRDDSS
  16.      Fortran
  17.  
  18. DDEESSCCRRIIPPTTIIOONN
  19.      The CCPPUU__TTIIMMEE intrinsic subroutine returns the user time if successful.
  20.      This intrinsic subroutine accepts the following argument:
  21.  
  22.      _t_i_m_e      Must be a scalar and of type real.  It is an output
  23.                argument.  The type of the argument is not restricted to any
  24.                particular kind type.
  25.  
  26.      The name of this intrinsic cannot be passed as an argument.  The time
  27.      returned by this intrinsic subroutine is user time on all systems.
  28.  
  29.      On UNICOS and UNICOS/mk systems, a call to CCPPUU__TTIIMMEE must be done once
  30.      and before the first timing loop to initialize the time structure.
  31.      CCPPUU__TTIIMMEE includes time accumulated by all processors in a multitasking
  32.      program.
  33.  
  34. RREETTUURRNN VVAALLUUEESS
  35.      CCPPUU__TTIIMMEE returns --11..00 if the time cannot be returned.
  36.  
  37. EEXXAAMMPPLLEESS
  38.      The following program uses the CCPPUU__TTIIMMEE intrinsic subroutine and was
  39.      run on an IRIX system:
  40.  
  41.           PROGRAM CPUTIMETEST
  42.           REAL RTIME(2)
  43.           CHARACTER(LEN=400)          :: EXPRIGHT2
  44.           CHARACTER(LEN=800)          :: EXPRIGHT
  45.           INTEGER  :: J
  46.           CALL CPU_TIME(RTIME(1))
  47.           IF (RTIME(1) .EQ. -1.0) THEN
  48.              PRINT *,'CPU_TIME NOT WORKING, QUIT'
  49.              PRINT *,'RTIME(1) =',RTIME(1)
  50.              STOP 'UNSUCCESSFUL'
  51.           ENDIF
  52.           CALL CPU_TIME(RTIME(1))
  53.           DO J = 1, 400
  54.              EXPRIGHT2(J:J) = " "
  55.           ENDDO
  56.           CALL CPU_TIME(RTIME(2))
  57.           PRINT *,'ELAPSED CPUTIME TIME=',RTIME(2) - RTIME(1)
  58.  
  59.           CALL CPU_TIME(RTIME(1))
  60.           DO J = 1, 800
  61.              EXPRIGHT(J:J) = " "
  62.           ENDDO
  63.           CALL CPU_TIME(RTIME(2))
  64.           PRINT *,'ELAPSED CPUTIME TIME=',RTIME(2) - RTIME(1)
  65.           end
  66.  
  67.      This program generated the following output:
  68.  
  69.           ELAPSED CPUTIME TIME= 1.109996811E-4
  70.           ELAPSED CPUTIME TIME= 2.029994503E-4
  71.  
  72. SSEEEE AALLSSOO
  73.      _I_n_t_r_i_n_s_i_c _P_r_o_c_e_d_u_r_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l for the printed version of this
  74.      man page.
  75.